package edu.gatech.teamrocket.models;

import com.j256.ormlite.field.DatabaseField;
import com.j256.ormlite.misc.BaseDaoEnabled;
import com.j256.ormlite.table.DatabaseTable;

@DatabaseTable (tableName = "categories")
public class Category extends BaseDaoEnabled {
	@DatabaseField(generatedId = true, columnName = "_id")
	private int id;
	
	@DatabaseField (canBeNull = false)
	private String name;
	
	@DatabaseField (canBeNull = false, foreign = true)
	private User user;
	
	Category() { }
	
	public Category(String name, User user) {
		this.name = name;
		this.setUser(user);
	}
	
	public int getId() {
		return this.id;
	}
	
	public String toString() {
		return this.name;
	}
	
	public String getName() {
		return this.name;
	}
	
	public void setName(String name) {
		this.name = name;
	}

	public User getUser() {
		return this.user;
	}

	public void setUser(User user) {
		this.user = user;
	}
}
